package com.ricchieri.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.springframework.cache.annotation.Cacheable;

import com.ricchieri.dao.interf.IEmailToSendTypeDao;
import com.ricchieri.filter.BasicFilter;
import com.ricchieri.model.EmailToSendType;

public class EmailToSendTypeDao extends GenericDao implements IEmailToSendTypeDao {

	private static final long serialVersionUID = 482499240774226029L;

	@Override
	@Cacheable(value="emailToSendType")
	@SuppressWarnings("unchecked")
	public List<EmailToSendType> getAllEmailToSendType(BasicFilter filter) {
		Criteria criteria = criteriaAllEmailToSendType(filter);
		
		return criteria.list();
	}
	
	private Criteria criteriaAllEmailToSendType(BasicFilter filter) {
		return super.criteriaAllBasic(filter, EmailToSendType.class);
	}	
	
	@Override
	protected String getTableName() {
		return "emailToSendType";
	}
}
